#ifndef __SALT_EVENTS_H
#define __SALT_EVENTS_H
#include "SALT_Config.h"

#include <map>

union SDL_Event;
typedef union SDL_Event SDL_Event;

namespace SALT{
	namespace Events{

		typedef int(*EventCallback)(void*);

		class _AbstractEventManager{
		protected:
			std::map<int,EventCallback>		_callbacks;
		public:
			_AbstractEventManager(){}
			~_AbstractEventManager(){}
			bool			isCallbackRegistered	(int key){
				return (this->_callbacks.find(key)!=this->_callbacks.end()) || this->_callbacks[key]==NULL;
			}
			void			registerCallback		(int key,EventCallback cb){
				this->_callbacks[key]=cb;
			}
			void			unregisterCallback		(int key){
				this->registerCallback(key,NULL);
			}
			virtual void	handleEvent				(void* data)=0;
		};

		class SDLEventManager:public _AbstractEventManager{
		public:
			void	handleEvent(void* data);
		};
	};
};

#endif